package com.fanrenqiji.entity;

import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.Where;

import javax.persistence.*;

/**
 * Created by yanwt on 2017/3/2.
 */
@Getter
@Setter
@Entity
@Table(name = "tb_course_item_event")
@org.hibernate.annotations.Table(appliesTo = "tb_course_item_event",comment = "课程详情事件")
@org.hibernate.annotations.DynamicInsert
@org.hibernate.annotations.DynamicUpdate
@org.hibernate.annotations.Cache(region="course_item_event", usage = CacheConcurrencyStrategy.READ_WRITE)
public class CourseItemEventEntity extends DataEntity{

    @Id
    @GeneratedValue(strategy= GenerationType.IDENTITY)
    private Long id;

    @Column(columnDefinition=("int(1) default null comment '类型 0:提问 1:举手 2:笑话 3:故事'"))
    private int type;

    @ManyToOne
    @JoinColumn(name="event_case_id",columnDefinition=("bigint(20) default null comment '事件实例ID'"))//,foreignKey = @ForeignKey(value=ConstraintMode.NO_CONSTRAINT))
    @Where(clause="del_flag=0")
    private EventCaseEntity eventCase;

    @Column(name="show_time",columnDefinition=("int(11) default null comment '展示时间'"))
    private int showTime;

    @Column(columnDefinition=("int(11) default null comment '时长'"))
    private int seconds;

}
